package doctor

import (
	"github.com/bgmp/config"
	"github.com/bgmp/model"
	"github.com/gin-gonic/gin"
)

func (b Base) GetPatientBgs(c *gin.Context, req *GetPatientBgRequest) *GetPatientBgResponse {
	bgs := model.ListBgViews(config.DB,
		map[string]any{model.Bg_UserId: req.PatientId},
		&req.BgSelectConditions,
	)
	return &GetPatientBgResponse{
		Bgs: bgs,
	}
}

type GetPatientBgRequest struct {
	PatientId uint `json:"patient_id"`
	model.BgSelectConditions
}

type GetPatientBgResponse struct {
	Bgs []model.BgView `json:"bgs"`
}
